

import 'package:flutter/material.dart';
import 'package:s_mankey/model/enterprise_list_model.dart';
import 'package:s_mankey/provider/view_state_model.dart';
import 'package:s_mankey/provider/view_state_refresh_list_model.dart';
import 'package:s_mankey/service/smonkey_repository.dart';

class EnterpriseListVModel extends ViewStateModel {

  List company;
  List area;
  List theCase;
  var datas;
  int tabCurIndex = 0;

  Future initData () async {
    setBusy();
    try {
      datas = await SmonkeysRepository.fetchEnterpriseList();
      company = datas['company'];
      area = datas['area'];
      theCase = datas['case'];
      tabCurIndex = theCase.length;
      setIdle();
    } catch (e, s){
      setError(e,s);
    }
  }
}